/*
 * @Author: luoyunhia
 * @Date: 2020-08-17 14:37:00
 * @LastEditors: kanglang
 * @LastEditTime: 2021-02-18 15:17:50
 * @Description: 4s店
 */

import { fetchGet, fetchPost } from '../config';

/**
 * @description: 货车品牌列表
 * @param {type} gcCode
 * @return: 
 */
export const getGoodsBrand = (params) => {
  return fetchGet(`shop-api/api/v1/goodsBrandApp/getGoodsBrand`, params);
};

/**
* @description: 获取车辆商品
* @param { page,size,brandId,categoryId }
* @return: 
*/
export const getGoodsCar = (params) => {
  return fetchGet(`shop-api/api/v1/pi/getGoodsCar`, params);
};


/**
* @description: 获取车辆详情图片
* @param {type} goodsId
* @return: 
*/
export const featchCarDetailImg = (params) => {
  return fetchGet(`shop-api/api/v1/subgraphApp/getGoodsSubgraph`, params);
};

/**
 * @description 获取车辆配置信息
 * @param {categoryId, goodsId}
 * 
 */
export const getParameter = params => {
  return fetchGet(`shop-api/api/v1/goodsInfoParameterApp/getParameter`, params);
}

/**
 * @description 车辆商品信息（联系我们页面）
 * @param {goodsId}
 * 
 */
export const getGoodsCarInfo = params => {
  return fetchGet(`shop-api/api/v1/pi/getGoodsCarInfo`, params);
}

/**
 * @description 统一确认订单(4S预约)
 * @param {
    "orderType":"6",  //4S下单预约
    "truckData":{
      "goodsId":"4028828c73eb90bd0173eb96b5300000"
    }
  }
 * 
 */
export const confirmOrder = params => {
  return fetchPost(`order-api/api/v1/order/confirmOrder`, params);
}

/**
 * @description 统一提交订单(4S预约)
 * @param {
      "orderType":"6",
      "integral":"0",
      "addressId":"",
      "truckData":{
          "goodsId":"4028828c73eb90bd0173eb96b5300000",  //商品id
          "name":"suofei",  //名字
          "mobile":"18680844304"  //电话
      }
    
  }
 * 
 */
export const submitOrder = params => {
  return fetchPost(`order-api/api/v1/order/submitOrder`, params);
}
